package com.snoob.springboot.user.controller;


import com.snoob.springboot.pipleline.vo.SysUserVoRes;
import com.snoob.springboot.pipleline.qo.SelectSysUserQo;
import com.snoob.springboot.user.entity.SysUserEntity;
import com.snoob.springboot.user.service.SysUserService;
import com.snoob.springboot.util.ConvertUtils;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * <p>
 * 系统管理员 前端控制器
 * </p>
 *
 * @author lixing_java@163.com
 * @since 2022-05-17
 */
//@RestController
//@RequestMapping("/sysUser")
@Component
public class SysUserController {
    @Resource
    private SysUserService sysUserService;

    /** 
     * 根据账号或者手机号码查询系统用户
     */
    public SysUserVoRes selectSysUserByAccountOrPhone(SelectSysUserQo qo) {
        SysUserEntity sysUserEntity = sysUserService.selectSysUserByAccountOrPhone(qo);
        // PO转化成DTO
        SysUserVoRes sysUserVoRes = ConvertUtils.convert(sysUserEntity, SysUserVoRes.class);
        return sysUserVoRes;
    }
}

